package com.leo.foodmaster.admin.stock.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.leo.foodmaster.admin.purchase.entity.PurchaseBill;
import com.leo.foodmaster.admin.purchase.entity.dto.PurchaseBillDTO;
import com.leo.foodmaster.admin.stock.entity.WarehouseInRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.leo.foodmaster.commons.entity.Result;

/**
 * <p>
 * 入库记录 服务类
 * </p>
 *
 * @author Leo
 * @since 2021-08-21
 */
public interface IWarehouseInRecordService extends IService<WarehouseInRecord> {

    /**
     * 条件分页查询入库记录列表
     * @param page 分页条件
     * @param warehouseId 仓库Id
     * @param serialNum 仓库编号
     * @param status 单据状态
     * @param beginTime 开始时间
     * @param endTime 结束时间
     * @return IPage<WarehouseInRecord>
     */
    IPage<WarehouseInRecord> getWarehouseInRecordPageList(Page<WarehouseInRecord> page, Long warehouseId,
                                                  String serialNum, String status,
                                                  String beginTime, String endTime);

    /**
     * 新增入库记录
     * @param warehouseInRecord 入库记录
     * @param isAuto 是否一键入库：1（是）2（否）
     * @return Result<Object>
     */
    Result<Object> addWarehouseInRecord(WarehouseInRecord warehouseInRecord, String isAuto);

    /**
     * 修改入库记录
     * @param warehouseInRecord 入库记录
     * @return Result<Object>
     */
    Result<Object> updateWarehouseInRecord(WarehouseInRecord warehouseInRecord);

    /**
     * 一键入库
     * @param purchaseBillDto 入库记录
     * @return Result<Object>
     */
    Result<Object> autoAddWarehouseInRecord(PurchaseBillDTO purchaseBillDto);

    /**
     * 一键入库食材信息检查
     * @param purchaseBill 采购清单
     * @return String
     */
    Result<Object> checkInfoForAutoAdd(PurchaseBill purchaseBill);

    /**
     * 删除采购清单
     * @param id 采购清单Id
     * @return Result<Object>
     */
    Result<Object> deleteWarehouseInRecord(Long id);

    /**
     * 审核入库记录
     * @param warehouseInRecord 入库记录信息
     * @return Result<Object>
     */
    Result<Object> checkWarehouseInRecord(WarehouseInRecord warehouseInRecord);
}
